<template>
    <div class="hi">
      <cm :mycity="city"></cm>
      <swiper :swiperLit="swiper"></swiper>
      <lei></lei>
      <quan></quan>
      <hua></hua>
      <xiangqing></xiangqing>
      <webu></webu>
    </div>
</template>

<script>
  import cm from "../cc/cm.vue"
  import swiper from "../cc/Swiper.vue"
  import lei from "../cc/lei.vue"
  import quan from "../cc/quan.vue"
  import hua from "../cc/hua.vue"
  import xiangqing from "../cc/xiangqing.vue"
  import webu from "../cc/wubu.vue"
  import axios from "axios"

    export default {
        name: 'hi',
        components:{
            cm,
         swiper,
            lei,
          quan,
          hua,
          xiangqing,
          webu,

        },
        data () {
            return {
                city:'',
               swiper:[],
            }
        },
        methods :{
          getHomeInfo(){
              axios.get("./static/index.json").then(this.getSucc);
          }  ,
          getSucc(res){
              res=res.data;
              if(res.ret && res.data){
                  const data=res.data;
                  this.city=data.city;
                  this.swiper=data.Imgsrc;
              }
              console.log(res);

          }

        },
        mounted:function () {//钩子函数  主要用来向后台请求数据做一些业务处理
          this.getHomeInfo()
        }
    }
</script>


